<?php
/**
 * Created by PhpStorm.
 * User: 王松
 * Time: 2017/11/22 15:27
 */

namespace App\Project\Search\Decorator;

use App\Project\Search\Decorator;

class PatientDecorator extends Decorator
{
    protected $table = 'tn_user_base';

    protected $prefix = 'patient';

    /**
     * @return \Illuminate\Database\Query\Builder
     */
    public function getBuilder()
    {
        return $this->fillBuilder([
            $this->table,
            'st_medical_records.patient_id',
            $this->table . '.id'
        ]);
    }

    public function getAccessField()
    {
        return ['age' => 'age', 'sex' => 'sex'];
    }

    public function getAccessOperator()
    {
        return [
            'sex' => ['eq'],
            'age' => ['eq', 'gt', 'lt', 'in', 'bt'],
        ];
    }
}